<!-- 
  * @Description:产品服务的搜索框 
  * @Author:lxy 
  * @Date:2023-03-24 10:23  
-->
<template>
  <div class="bioati">
    <el-form
      ref="searchFromRef"
      :model="searchFromData"
      :inline="true"
      class="demo-ruleForm"
    >
      <el-row type="flex" justify="space-between">
        <el-form-item label="标题：">
          <el-input
            placeholder="请输入"
            v-model="searchFromData.title"
          ></el-input>
        </el-form-item>

        <el-form-item label="简介：">
          <el-input
            placeholder="请输入"
            v-model="searchFromData.introduction"
          ></el-input>
        </el-form-item>


        <el-form-item>
          <div style="text-align: right;">
            <el-button icon="el-icon-refresh" @click="resetForm">重置</el-button>
            <el-button type="primary" icon="el-icon-search" @click="submitFrom">查询</el-button>
          </div>
        </el-form-item>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  name: "searchFrom",
  data() {
    return {
      searchFromData: {
        title: "",
        introduction: "",
      },
    };
  },
  methods:{
    submitFrom(){
      this.$emit('forSubmit',1)      
    },
    getSearchForm(){
      //方便外面主动来获取数据
      return this.searchFromData
    },
    resetForm(){
      //重置操作
      this.searchFromData.title = ''
      this.searchFromData.introduction = ''
      //接着发送数据 进行网络请求
      this.$emit('forSubmit',1)      
    }
  }
};
</script>

<style scoped lang="less">
.bioati{
  margin: 15px 0px;
  align-items: center;
  height: 40px;
}
.demo-ruleForm > .el-row {
  :deep(.el-form-item) {
    width: 360px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .el-form-item__label {
      white-space: nowrap !important;
    }
    .el-form-item__content {
      flex: 1;
    }
  }
}
</style>
